From: Emilio Pozuelo Monfort Date: Fri, 12 Jul 2013 09:07:18 +0000 (+0200) Subject: StWidget: use a handler id to disconnect the callback X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~3956 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=c9b079cbb5f0a60808e8602ae4ac892091b18a8b;p=gnome-shell.git StWidget: use a handler id to disconnect the callback g_signal_handlers_disconnect_by_func() is much more expensive than g_signal_handler_disconnect(), so use the latter. https://bugzilla.gnome.org/show_bug.cgi?id=704077 --- diff --git a/src/st/st-widget.c b/src/st/st-widget.c index 4cbe0ec29..d74f8ed60 100644 --- a/src/st/st-widget.c +++ b/src/st/st-widget.c @@ -67,6 +67,8 @@ struct _StWidgetPrivate gboolean hover : 1; gboolean can_focus : 1; + gulong texture_file_changed_id; + AtkObject *accessible; AtkRole accessible_role; AtkStateSet *local_state_set; @@ -362,9 +364,11 @@ st_widget_dispose (GObject *gobject) priv->label_actor = NULL; } - g_signal_handlers_disconnect_by_func (st_texture_cache_get_default (), - st_widget_texture_cache_changed, - actor); + if (priv->texture_file_changed_id != 0) + { + g_signal_handler_disconnect (st_texture_cache_get_default (), priv->texture_file_changed_id); + priv->texture_file_changed_id = 0; + } g_clear_object (&priv->prev_first_child); g_clear_object (&priv->prev_last_child); @@ -1552,8 +1556,8 @@ st_widget_init (StWidget *actor) g_signal_connect (actor, "notify::first-child", G_CALLBACK (st_widget_first_child_notify), NULL); g_signal_connect (actor, "notify::last-child", G_CALLBACK (st_widget_last_child_notify), NULL); - g_signal_connect (st_texture_cache_get_default (), "texture-file-changed", - G_CALLBACK (st_widget_texture_cache_changed), actor); + priv->texture_file_changed_id = g_signal_connect (st_texture_cache_get_default (), "texture-file-changed", + G_CALLBACK (st_widget_texture_cache_changed), actor); for (i = 0; i < G_N_ELEMENTS (priv->paint_states); i++) st_theme_node_paint_state_init (&priv->paint_states[i]);